<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld" %>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<html>
<head><title>查询</title>
    <script type="text/javascript">
        /***
         * 查询
         */
        function btnQuery() {
            document.forms[0].submit();
        }
        /***
         *跳转到修改页面
         * @param id
         */
        function btnGoUpdate(id) {
            document.forms[0].action = '/action/student/btnGoUpdate';
            document.getElementById('dtId').value = id;
            document.forms[0].submit();
        }
        /***
         *删除
         * @param id
         */
        function btnDelete(id) {
            document.forms[0].action = '/action/student/btnDelete';
            document.getElementById('dtId').value = id;
            document.forms[0].submit();
        }
    </script>
</head>
<body>
<c:if test="${!empty msg}">
    <script type="text/javascript">
        alert("${msg}");
    </script>
</c:if>
<form action="/action/student/btnQuery" method="post">
    <input type="hidden" name="dt.id" id='dtId' value="${dt.id}">
    <table>
        <tr>
            <td colspan="3">
                姓名：<input type="text" name="dt.name" value="${dt.name}">

                &nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" value="查询"> &nbsp;&nbsp;&nbsp;&nbsp;
                <input type="button" onclick="window.location.href='/index.jsp'" value="首页">
            </td>
        </tr>
        <tr>
            <th>序号</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>简介</th>
            <th>操作</th>
        </tr>
        <c:forEach var="rowData" items="${list}" varStatus="status">
            <tr>
                <td>${status.count}</td>
                <td>${rowData.name}</td>
                <td>${rowData.age}</td>
                <td>
                    <c:choose>
                        <c:when test="${rowData.sex==0}">男</c:when>
                        <c:otherwise>女</c:otherwise>
                    </c:choose></td>
                <td>${rowData.summary}</td>
                <td>
                    <a onclick="btnGoUpdate('${rowData.id}')" style="cursor: pointer"><u>修改</u></a>
                    &nbsp;|&nbsp;
                    <a onclick="btnDelete('${rowData.id}')" style="cursor: pointer"><u>删除</u></a>
                </td>
            </tr>
        </c:forEach>
    </table>
    <jsp:include page="../include/page.jsp" flush="true"/>
</form>
</body>
</html>